<HTML><HEAD><TITLE>getcwd(-Cwd)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Operating System</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>getcwd(-Cwd)</H1>
Unifies the current working directory with Cwd.


<DL>
<DT><EM>Cwd</EM></DT>
<DD>String or Variable.
</DD>
</DL>
<H2>Description</H2>
   Cwd is unified with the current working directory including the final
   "/".

<P>
   Equivalent to get_flag(cwd, Cwd).  To set the current working directory,
   use set_flag(cwd, Directory) or cd(Directory).

<P>

<H3>Modes and Determinism</H3><UL>
<LI>getcwd(-) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Cwd is instantiated but not to a string.
</DL>
<H2>Examples</H2>
<PRE>
Success:
     [eclipse]: sh(pwd).
     /home/user/test
     yes.
     [eclipse]: getcwd(Cwd).
     Cwd = "/home/user/test/"
     yes.

Fail:
    getcwd("nodirectory").

Error:
      getcwd(1).           (Error 5).
      getcwd(atom).        (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/opsys/cd-1.html">cd / 1</A>, <A HREF="../../kernel/env/get_flag-2.html">get_flag / 2</A>, <A HREF="../../kernel/env/set_flag-2.html">set_flag / 2</A>, <A HREF="../../kernel/opsys/mkdir-1.html">mkdir / 1</A>
</BODY></HTML>
